package com.tianyang.yukuaifu.jump.jsbridge;

import androidx.annotation.NonNull;

import com.tencent.smtt.export.external.interfaces.JsPromptResult;
import com.tencent.smtt.sdk.WebView;
import com.tianyang.yukuaifu.jump.jsbridge.common.IPromptResult;
import com.tianyang.yukuaifu.jump.jsbridge.common.IWebView;
import com.tianyang.yukuaifu.jump.jsbridge.module.JsModule;

/**
 * Description：
 * Created by 薛勇军 on 2018/6/11.
 */
public abstract class JsBridge {

    public static final String TAG = "JsBridgeDebug";

    public abstract void injectJs(@NonNull WebView webView);

    public abstract void injectJs(@NonNull IWebView webView);

    public abstract void callJsPrompt(@NonNull String methodArgs, @NonNull JsPromptResult result);

    public abstract void callJsPrompt(@NonNull String methodArgs, @NonNull IPromptResult result);

    public abstract void clean();

    public abstract void release();

    public static JsBridge loadModule(Class<? extends JsModule>... modules) {
        return new JsBridgeImpl(modules);
    }
}
